package homework.My21Point;

import java.util.Scanner;

public class taxCost {
    public static void main(String[] args) {
        double len=0,type,money;
        System.out.println("请输入您要乘坐的出租车类型：1：夏利2：富士康3：桑塔纳");
        Scanner scanner = new Scanner(System.in);
        type = scanner.nextInt();
        if(type==1)
        {
            System.out.println("请输入您行驶的距离");
            len = scanner.nextInt();
            if(len>3) {
                money=3 +2.1*(len-3);
            }else{
                money=3;
            }
            System.out.println("您乘坐的是夏利出租车，本次行驶路程为"+len+
                    "总费用为"+money);
        }

        if(type==2)
        {
            System.out.println("请输入您行驶的距离");
            len = scanner.nextInt();
            if(len>3) {
                money=4 +2.4*(len-3);
            }else{
                money=4;
            }
            System.out.println("您乘坐的是富士康出租车，本次行驶路程为"+len+
                    "总费用为"+money);
        }
        if(type==3)
        {
            System.out.println("请输入您行驶的距离");
            len = scanner.nextInt();
            if(len>3) {
                money=5 +2.7*(len-3);
            }else{
                money=5;
            }
            System.out.println("您乘坐的是桑塔纳出租车，本次行驶路程为"+len+
                    "总费用为"+money);
        }
        if(type==4)
        {
            System.out.println("请输入您行驶的距离");
            len = scanner.nextInt();

            System.out.println("出租车坏了，免单");
        }


    }
}

